<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>hdf5write</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="hdf5read.html" title="hdf5read" />
    <link rel="next" href="hilbert.html" title="hilbert" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">hdf5write</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="hdf5read.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="hilbert.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="hdf5write"></a>
      <div class="titlepage"></div>
      <a id="IndexHdf5write" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">hdf5write</span>
        </h2>
        <p>hdf5write — 
      Write signals and arrays to an hdf5 file.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp113993328"></a>
        <h2>Description</h2>
        <p>
      <span class="emphasis"><em>hdf5write</em></span> writes <span class="emphasis"><em>N</em></span> signals and arrays to a specified hdf5 file.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp114060768"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>hdf5write</strong></span> ifilename, xout1[, xout2, xout3, ..., xoutN]</pre>
      </div>
      <div class="refsect1">
        <a id="idp114062816"></a>
        <h2>Initialization</h2>
        <p>
      <span class="emphasis"><em>ifilename</em></span> -- the hdf5 file's name (in double-quotes). If the file does not exist it will be created.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp114064528"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>xout1,... xoutN</em></span> -- signals or arrays to be written to the hdf5 file. This opcode accepts i-rate, k-rate, a-rate signals or i-rate, k-rate, a-rate arrays of any dimension. These signals or arrays are written to a dataset within the hdf5 file using the same variable name as in Csound. For example, if the Csound variable is called 'ksignal', then the name of the hdf5 dataset is 'ksignal'. Any number and multiple types of datasets may be written at a time.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp114066592"></a>
        <h2>Examples</h2>
        <p>
      Here is a simple example of the hdf5write opcode. It uses the file <a class="ulink" href="examples/hdf5write.csd" target="_top"><em class="citetitle">hdf5write.csd</em></a>.

      </p>
        <div class="example">
          <a id="idp114068464"></a>
          <p class="title">
            <strong>Example 366. Example of the hdf5write opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
-odac
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span> <span class="op">=</span> 1
<span class="ohdr">ksmps</span> <span class="op">=</span> 8
<span class="ohdr">sr</span> <span class="op">=</span> 44100

<span class="oblock">instr</span> <span class="opc">hdf5write</span>

    aArray[] <span class="opc">init</span> 2,2 <span class="comment">; Initialise a 2 X 2 a-rate array</span>

    aArray[0][0] <span class="opc">vco2</span> 0.2, 100 <span class="comment">; Fill array with vco2 signals</span>
    aArray[0][1] <span class="opc">vco2</span> 0.4, 200
    aArray[1][0] <span class="opc">vco2</span> 0.8, 300
    aArray[1][1] <span class="opc">vco2</span> 1, 400

    aVar <span class="opc">vco2</span> 0.2, 100 <span class="comment">; Initialise an a-rate variable with a vco2 signal</span>

    kVar <span class="opc">phasor</span> 1 <span class="comment">; Initalise a k-rate variable with a phasor signal</span>

    <span class="opc">hdf5write</span> "example.h5", aArray, aVar, kVar <span class="comment">; Write variables to an hdf5 file</span>

<span class="oblock">endin</span>

<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span> "hdf5wr<span class="stamnt">i</span>te" 0 1

<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp114072704"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="hdf5read.html" title="hdf5read"><em class="citetitle">hdf5read</em></a>
    </p>
      </div>
      <div class="refsect1">
        <a id="idp114074752"></a>
        <h2>Credits</h2>
        <p>
      </p>
        <table border="0" summary="Simple list" class="simplelist">
          <tr>
            <td>Author: Edward Costello;</td>
          </tr>
          <tr>
            <td>NUIM, 2014</td>
          </tr>
        </table>
        <p>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="hdf5read.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="hilbert.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">hdf5read </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> hilbert</td>
        </tr>
      </table>
    </div>
  </body>
</html>
